<?xml version="1.0" encoding="iso-8859-1"?>

<!-- 
  -- Please see the readme.txt file included with this distribution for 
  -- attribution and copyright information.
  -->

<root version="2.0">
	<windowclass name="charsheet_main">
		<placement>
			<size>
				<width>252</width>
				<height>611</height>
			</size>
		</placement>
		<nodelete />
		<sheetdata>
			<tokenfield name="combattoken">
				<bounds>432,30,60,51</bounds>
				<empty>indicator_emptytoken</empty>
			</tokenfield>
		
			<!-- ACTIVATE IDENTITY -->
			<buttoncontrol>
				<bounds>-40,30,23,22</bounds>
				<icon>
					<normal>button_identityactivate</normal>
					<pressed>button_identityactivate_down</pressed>
				</icon>
				<script>
					function onButtonPress()
						if User.isHost() then
							GmIdentityManager.addIdentity(window.name.getValue());
						else
							local identityname = window.getDatabaseNode().getName();

							User.setCurrentIdentity(identityname);

							if CampaignRegistry and CampaignRegistry.colortables and CampaignRegistry.colortables[identityname] then
								local colortable = CampaignRegistry.colortables[identityname];
								User.setCurrentIdentityColors(colortable.color or "000000", colortable.blacktext or false);
							end
						end
					end
				</script>
			</buttoncontrol>
		
			<!-- OVERVIEW -->
			<genericcontrol name="overviewframe">
				<bounds>15,20,415,70</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<labeledstring name="name">
				<anchored>
					<to>overviewframe</to>
					<position>insidetopleft</position>
					<offset>15,10</offset>
					<size>
						<width>250</width>
						<height>20</height>
					</size>
				</anchored>
				<label>name</label>
				<tabtarget>
					<next>race</next>
					<prev>appearance</prev>
				</tabtarget>
			</labeledstring>

			<labeledstring name="race">
				<anchored>
					<to>overviewframe</to>
					<position>insidetopleft</position>
					<offset>275,10</offset>
					<size>
						<width>125</width>
						<height>20</height>
					</size>
				</anchored>
				<label>race</label>
				<tabtarget>
					<next>class1</next>
					<prev>name</prev>
				</tabtarget>
			</labeledstring>

			<labeledstring name="class1" source="class.base">
				<anchored>
					<to>overviewframe</to>
					<position>insidetopleft</position>
					<offset>15,35</offset>
					<size>
						<width>125</width>
						<height>20</height>
					</size>
				</anchored>
				<label>class</label>
				<tabtarget>
					<next>class2</next>
					<prev>race</prev>
				</tabtarget>
			</labeledstring>

			<labeledstring name="class2" source="class.paragon">
				<anchored>
					<to>class1</to>
					<position>right</position>
					<offset>5,0</offset>
					<size>
						<width>125</width>
					</size>
				</anchored>
				<label>Paragon Path</label>
				<tabtarget>
					<next>class3</next>
					<prev>class1</prev>
				</tabtarget>
			</labeledstring>

			<labeledstring name="class3" source="class.epic">
				<anchored>
					<to>class2</to>
					<position>right</position>
					<offset>5,0</offset>
					<size>
						<width>125</width>
					</size>
				</anchored>
				<label>Epic Destiny</label>
				<tabtarget>
					<next>level</next>
					<prev>class2</prev>
				</tabtarget>
			</labeledstring>

			<!-- LEVEL -->
			<genericcontrol name="levelframe">
				<bounds>15,90,145,160</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<sheetnumber name="level">
				<anchored>
					<to>levelframe</to>
					<position>insidetopleft</position>
					<offset>15,29</offset>
					<size>
						<width>32</width>
						<height>20</height>
					</size>
				</anchored>
				<frame>
					<name>bonus</name>
					<offset>5,4,5,4</offset>
				</frame>
				<tabtarget>
					<next>expneeded</next>
					<prev>class3</prev>
				</tabtarget>
			</sheetnumber>
			<stringcontrol name="levellabel">
				<anchored>
					<to>level</to>
					<position>right</position>
					<offset>10,-3</offset>
					<size>
						<width>40</width>
					</size>
				</anchored>
				<font>sheetlabel</font>
				<static>Level</static>
			</stringcontrol>
			<linkednumber name="levelbonus">
				<anchored>
					<to>level</to>
					<position>right</position>
					<offset>50,0</offset>
					<size>
						<width>32</width>
					</size>
				</anchored>
				<font>sheetnumber</font>
				<displaysign />
				<readonly />
				<frame>
					<name>modifier</name>
					<offset>5,4,5,4</offset>
				</frame>
				<source>
					<name>level</name>
					<op>+</op>
				</source>
				<script>
					function onSourceUpdate()
						setValue(math.floor(calculateSources() / 2));
					end
				</script>
			</linkednumber>
			<stringcontrol>
				<anchored>
					<to>levelbonus</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<font>sheetlabelmini</font>
				<static>Mod</static>
				<center />
			</stringcontrol>

			<jpgnumberfield name="exp">
				<anchored>
					<to>levelframe</to>
					<position>insidetop</position>
					<offset>-15,80</offset>
					<size>
						<height>20</height>
					</size>
				</anchored>
				<frame>
					<name>bonus</name>
					<offset>5,5,5,5</offset>
				</frame>
				<keyeditframe>
					<name>sheetfocus</name>
					<offset>5,5,5,5</offset>
				</keyeditframe>
				<font>sheetnumbersmall</font>
				<noreset />
				<stateframe>
					<drophilight>
						<name>sheetfocusplus</name>
						<offset>5,5,5,5</offset>
					</drophilight>
				</stateframe>
				<droptypes>
					<type>number</type>
				</droptypes>
				<tabtarget>
					<next>expneeded</next>
					<prev>level</prev>
				</tabtarget>
				<script>
					function onDrop(x, y, draginfo)
						if draginfo.isType("number") then
							setValue(getValue() + draginfo.getNumberData());
							return true;
						end
					end
				</script>
			</jpgnumberfield>
			<stringcontrol>
				<anchored>
					<to>exp</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<static>Experience Points</static>
				<font>sheetlabelmini</font>
				<center />
			</stringcontrol>

			<jpgnumberfield name="expneeded">
				<anchored>
					<to>exp</to>
					<position>below</position>
					<offset>0,24</offset>
					<size>
						<height>20</height>
					</size>
				</anchored>
				<frame>
					<name>bonus</name>
					<offset>5,5,5,5</offset>
				</frame>
				<keyeditframe>
					<name>sheetfocus</name>
					<offset>5,5,5,5</offset>
				</keyeditframe>
				<font>sheetnumbersmall</font>
				<noreset />
				<stateframe>
					<drophilight>
						<name>sheetfocus</name>
						<offset>5,5,5,5</offset>
					</drophilight>
				</stateframe>
				<droptypes>
					<type>number</type>
				</droptypes>
				<tabtarget>
					<next>strength</next>
					<prev>exp</prev>
				</tabtarget>
				<script>
					function onHover(oncontrol)
						if oncontrol then
							local draginfo = Input.getDragData();
							if draginfo and draginfo.isType("number") and draginfo.getNumberData() &lt; getValue() then
								setColor("ffbb0000");
							end
						else
							setColor(nil);
						end
					end
					
					function onDrop(x, y, draginfo)
						if draginfo.isType("number") and draginfo.getNumberData() &gt; getValue() then
							setValue(draginfo.getNumberData());
						end

						return true;
					end
				</script>
			</jpgnumberfield>
			<stringcontrol>
				<anchored>
					<to>expneeded</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<static>Needed for next</static>
				<font>sheetlabelmini</font>
				<center />
			</stringcontrol>

			<!-- ACTION POINTS -->
			<genericcontrol name="apframe">
				<bounds>15,250,145,50</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<sheetnumber name="actionpoints">
				<anchored>
					<to>apframe</to>
					<position>insidetopleft</position>
					<offset>85,15</offset>
					<size>
						<width>30</width>
						<height>20</height>
					</size>
				</anchored>
				<frame>
					<name>bonus</name>
					<offset>5,5,5,5</offset>
				</frame>
				<tabtarget>
					<next>name</next>
					<prev>vision</prev>
				</tabtarget>
				<script>
					function onDoubleClick(x,y)
						CharSheetCommon.useActionPoint(window.getDatabaseNode());
						return true;
					end
				</script>
			</sheetnumber>
			<checkbox name="apused">
				<anchored>
					<to>actionpoints</to>
					<position>right</position>
					<offset>5,0</offset>
					<size>
						<width>15</width>
					</size>
				</anchored>
				<parameters>
					<tooltips>AP Used Since Rest</tooltips>
					<defaulttooltip>AP Not Used Since Rest</defaulttooltip>
				</parameters>
			</checkbox>
			<stringcontrol name="aplabel">
				<anchored>
					<to>actionpoints</to>
					<position>lefthigh</position>
					<offset>0,5</offset>
					<size>
						<width>80</width>
						<height>20</height>
					</size>
				</anchored>
				<font>sheetlabelsmall</font>
				<static>Action Points</static>
				<center />
			</stringcontrol>

			<!-- ABILITIES -->
			<genericcontrol name="abilityframe">
				<bounds>160,90,240,210</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<abilityscore name="strength" source="abilities.strength.score">
				<anchored>
					<to>abilityframe</to>
					<position>insidetopleft</position>
					<offset>15,29</offset>
				</anchored>
				<tabtarget>
					<next>constitution</next>
					<prev>actionpoints</prev>
				</tabtarget>
			</abilityscore>
			<abilityscore name="constitution" source="abilities.constitution.score">
				<anchored>
					<to>strength</to>
				</anchored>
				<tabtarget>
					<next>dexterity</next>
					<prev>strength</prev>
				</tabtarget>
			</abilityscore>
			<abilityscore name="dexterity" source="abilities.dexterity.score">
				<anchored>
					<to>constitution</to>
				</anchored>
				<tabtarget>
					<next>intelligence</next>
					<prev>constitution</prev>
				</tabtarget>
			</abilityscore>
			<abilityscore name="intelligence" source="abilities.intelligence.score">
				<anchored>
					<to>dexterity</to>
				</anchored>
				<tabtarget>
					<next>wisdom</next>
					<prev>dexterity</prev>
				</tabtarget>
			</abilityscore>
			<abilityscore name="wisdom" source="abilities.wisdom.score">
				<anchored>
					<to>intelligence</to>
				</anchored>
				<tabtarget>
					<next>charisma</next>
					<prev>intelligence</prev>
				</tabtarget>
			</abilityscore>
			<abilityscore name="charisma" source="abilities.charisma.score">
				<anchored>
					<to>wisdom</to>
				</anchored>
				<tabtarget>
					<next>hp</next>
					<prev>wisdom</prev>
				</tabtarget>
			</abilityscore>
			
			<abilitycheckbonus name="strengthcheck" source="abilities.strength.check">
				<anchored>
					<to>strength</to>
				</anchored>
				<target>strength</target>
				<abilitybonusfield>abilities.strength.bonus</abilitybonusfield>
				<levelbonusfield>levelbonus</levelbonusfield>
			</abilitycheckbonus>
			<abilitycheckbonus name="constitutioncheck" source="abilities.constitution.check">
				<anchored>
					<to>constitution</to>
				</anchored>
				<target>constitution</target>
				<abilitybonusfield>abilities.constitution.bonus</abilitybonusfield>
				<levelbonusfield>levelbonus</levelbonusfield>
			</abilitycheckbonus>
			<abilitycheckbonus name="dexteritycheck" source="abilities.dexterity.check">
				<anchored>
					<to>dexterity</to>
				</anchored>
				<target>dexterity</target>
				<abilitybonusfield>abilities.dexterity.bonus</abilitybonusfield>
				<levelbonusfield>levelbonus</levelbonusfield>
			</abilitycheckbonus>
			<abilitycheckbonus name="intelligencecheck" source="abilities.intelligence.check">
				<anchored>
					<to>intelligence</to>
				</anchored>
				<target>intelligence</target>
				<abilitybonusfield>abilities.intelligence.bonus</abilitybonusfield>
				<levelbonusfield>levelbonus</levelbonusfield>
			</abilitycheckbonus>
			<abilitycheckbonus name="wisdomcheck" source="abilities.wisdom.check">
				<anchored>
					<to>wisdom</to>
				</anchored>
				<target>wisdom</target>
				<abilitybonusfield>abilities.wisdom.bonus</abilitybonusfield>
				<levelbonusfield>levelbonus</levelbonusfield>
			</abilitycheckbonus>
			<abilitycheckbonus name="charismacheck" source="abilities.charisma.check">
				<anchored>
					<to>charisma</to>
				</anchored>
				<target>charisma</target>
				<abilitybonusfield>abilities.charisma.bonus</abilitybonusfield>
				<levelbonusfield>levelbonus</levelbonusfield>
			</abilitycheckbonus>
			
			<abilitybonus name="strengthbonus" source="abilities.strength.bonus">
				<anchored>
					<to>strength</to>
				</anchored>
				<scorefield>abilities.strength.score</scorefield>
				<modifierfield>abilities.strength.bonusmodifier</modifierfield>
			</abilitybonus>
			<abilitybonus name="constitutionbonus" source="abilities.constitution.bonus">
				<anchored>
					<to>constitution</to>
				</anchored>
				<scorefield>abilities.constitution.score</scorefield>
				<modifierfield>abilities.constitution.bonusmodifier</modifierfield>
			</abilitybonus>
			<abilitybonus name="dexteritybonus" source="abilities.dexterity.bonus">
				<anchored>
					<to>dexterity</to>
				</anchored>
				<scorefield>abilities.dexterity.score</scorefield>
				<modifierfield>abilities.dexterity.bonusmodifier</modifierfield>
			</abilitybonus>
			<abilitybonus name="intelligencebonus" source="abilities.intelligence.bonus">
				<anchored>
					<to>intelligence</to>
				</anchored>
				<scorefield>abilities.intelligence.score</scorefield>
				<modifierfield>abilities.intelligence.bonusmodifier</modifierfield>
			</abilitybonus>
			<abilitybonus name="wisdombonus" source="abilities.wisdom.bonus">
				<anchored>
					<to>wisdom</to>
				</anchored>
				<scorefield>abilities.wisdom.score</scorefield>
				<modifierfield>abilities.wisdom.bonusmodifier</modifierfield>
			</abilitybonus>
			<abilitybonus name="charismabonus" source="abilities.charisma.bonus">
				<anchored>
					<to>charisma</to>
				</anchored>
				<scorefield>abilities.charisma.score</scorefield>
				<modifierfield>abilities.charisma.bonusmodifier</modifierfield>
			</abilitybonus>

			<abilitylabel>
				<anchored>
					<to>strengthbonus</to>
				</anchored>
				<static>Strength</static>
			</abilitylabel>
			<abilitylabel>
				<anchored>
					<to>constitutionbonus</to>
				</anchored>
				<static>Constitution</static>
			</abilitylabel>
			<abilitylabel>
				<anchored>
					<to>dexteritybonus</to>
				</anchored>
				<static>Dexterity</static>
			</abilitylabel>
			<abilitylabel>
				<anchored>
					<to>intelligencebonus</to>
				</anchored>
				<static>Intelligence</static>
			</abilitylabel>
			<abilitylabel>
				<anchored>
					<to>wisdombonus</to>
				</anchored>
				<static>Wisdom</static>
			</abilitylabel>
			<abilitylabel>
				<anchored>
					<to>charismabonus</to>
				</anchored>
				<static>Charisma</static>
			</abilitylabel>
			
			<stringcontrol>
				<anchored>
					<to>strength</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<font>sheetlabelmini</font>
				<static>Score</static>
				<center />
			</stringcontrol>
			<stringcontrol>
				<anchored>
					<to>strengthbonus</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<font>sheetlabelmini</font>
				<static>Mod</static>
				<center />
			</stringcontrol>
			<stringcontrol>
				<anchored>
					<to>strengthcheck</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<font>sheetlabelmini</font>
				<static>Check</static>
				<center />
			</stringcontrol>


			<!-- HP -->
			<genericcontrol name="hpframe">
				<bounds>15,300,385,160</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<hitpointfield name="hp" source="hp.total">
				<anchored>
					<to>hpframe</to>
					<position>insidetopleft</position>
					<top>
						<offset>26</offset>
					</top>
					<left>
						<offset>120</offset>
					</left>
					<size>
						<height>20</height>
						<width>46</width>
					</size>
				</anchored>
				<noreset />
				<tabtarget>
					<next>temphp</next>
					<prev>expneeded</prev>
				</tabtarget>
				<script>
					function onValueChanged()
						window.bloodied.setValue(math.floor(getValue() / 2));
						
						window.wounds.onValueChanged();
					end
				</script>
			</hitpointfield>

			<stringcontrol name="hplabel">
				<anchored>
					<to>hp</to>
					<position>lefthigh</position>
					<offset>0,3</offset>
					<size>
						<width>105</width>
						<height>20</height>
					</size>
				</anchored>
				<font>sheetlabel</font>
				<static>Hit Points</static>
			</stringcontrol>

			<jpgnumberfield name="bloodied" source="hp.bloodied">
				<anchored>
					<to>hp</to>
					<position>right</position>
					<offset>18,0</offset>
					<size>
						<width>46</width>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>5,5,5,5</offset>
				</frame>
				<font>sheetnumber</font>
				<noreset />
				<readonly />
			</jpgnumberfield>
			<stringcontrol>
				<anchored>
					<to>bloodied</to>
					<position>above</position>
					<offset>0,3</offset>
				</anchored>
				<static>Bloodied</static>
				<font>sheetlabelmini</font>
				<center />
			</stringcontrol>

			<sheetnumber name="temphp" source="hp.temporary">
				<anchored>
					<to>bloodied</to>
					<position>right</position>
					<offset>18,0</offset>
					<size>
						<width>46</width>
					</size>
				</anchored>
				<frame>
					<name>bonus</name>
					<offset>5,5,5,5</offset>
				</frame>
				<tabtarget>
					<next>wounds</next>
					<prev>hp</prev>
				</tabtarget>
				<hideonvalue value="0" />
				<script>
					function onDrop(x, y, draginfo)
						if draginfo.getType() == "number" then
							if draginfo.getNumberData() &gt; 0 then
								setValue(draginfo.getNumberData());
							else
								setValue(getValue() + draginfo.getNumberData());
							end
						end
						
						return true;
					end
				</script>
			</sheetnumber>
			<stringcontrol>
				<anchored>
					<to>temphp</to>
					<position>above</position>
					<offset>0,3</offset>
				</anchored>
				<static>Temp</static>
				<font>sheetlabelmini</font>
				<center />
			</stringcontrol>

			<hitpointfield name="wounds" source="hp.wounds">
				<anchored>
					<to>temphp</to>
					<position>right</position>
					<offset>18,0</offset>
					<size>
						<width>46</width>
					</size>
				</anchored>
				<tabtarget>
					<next>healsurgesmax</next>
					<prev>temphp</prev>
				</tabtarget>
				<hideonvalue value="0" />
				<script>
					function onInit()
						if super.onInit then
							super.onInit();
						end
					
						onValueChanged();
					end
					
					function onDrop(x, y, draginfo)
						if draginfo.getType() == "number" then
							local rActor = CombatCommon.getActor("pc", window.getDatabaseNode());
							RulesManager.applyDamage(rActor, draginfo.getNumberData(), draginfo.getDescription());
						end
						
						return true;
					end
					
					function onValueChanged()
						local percent_wounded = 0;
						if window.hp.getValue() &gt; 0 then
							percent_wounded = window.wounds.getValue() / window.hp.getValue();
						end
						if percent_wounded &lt;= 0 then
							setFont("sheetnumber");
						elseif percent_wounded &lt; .5 then
							setFont("charsheet_light");
						elseif percent_wounded &lt; 1 then
							setFont("charsheet_bloodied");
						else
							setFont("charsheet_dead");
						end
					end
				</script>
			</hitpointfield>
			<stringcontrol>
				<anchored>
					<to>wounds</to>
					<position>above</position>
					<offset>0,3</offset>
				</anchored>
				<static>Wounds</static>
				<font>sheetlabelmini</font>
				<center />
			</stringcontrol>

			<sheetnumber name="healsurgesmax" source="hp.surgesmax">
				<anchored>
					<to>hpframe</to>
					<position>insidetopleft</position>
					<top>
						<offset>69</offset>
					</top>
					<left>
						<offset>120</offset>
					</left>
					<size>
						<height>20</height>
						<width>46</width>
					</size>
				</anchored>
				<frame>
					<name>bonus</name>
					<offset>5,5,5,5</offset>
				</frame>
				<hideonvalue value="0" />
				<tabtarget>
					<next>healsurgesused</next>
					<prev>wounds</prev>
				</tabtarget>
			</sheetnumber>
			<stringcontrol>
				<anchored>
					<to>healsurgesmax</to>
					<position>above</position>
					<offset>0,3</offset>
				</anchored>
				<static>Per Day</static>
				<font>sheetlabelmini</font>
				<center />
			</stringcontrol>

			<stringcontrol name="healsurgelabel">
				<anchored>
					<to>healsurgesmax</to>
					<position>lefthigh</position>
					<offset>0,3</offset>
					<size>
						<width>105</width>
						<height>20</height>
					</size>
				</anchored>
				<font>sheetlabel</font>
				<static>Healing Surge</static>
			</stringcontrol>

			<sheetnumber name="healsurgesused" source="hp.surgesused">
				<anchored>
					<to>healsurgesmax</to>
					<position>right</position>
					<offset>18,0</offset>
					<size>
						<width>46</width>
					</size>
				</anchored>
				<frame>
					<name>bonus</name>
					<offset>5,5,5,5</offset>
				</frame>
				<tabtarget>
					<next>save</next>
					<prev>healsurgesmax</prev>
				</tabtarget>
				<hideonvalue value="0" />
			</sheetnumber>
			<stringcontrol>
				<anchored>
					<to>healsurgesused</to>
					<position>above</position>
					<offset>0,3</offset>
				</anchored>
				<static>Spent</static>
				<font>sheetlabelmini</font>
				<center />
			</stringcontrol>

			<sheetbonus name="healsurge" source="hp.surge">
				<anchored>
					<to>healsurgesused</to>
					<position>right</position>
					<offset>82,0</offset>
					<size>
						<width>46</width>
					</size>
				</anchored>
				<modifiersize>mini</modifiersize>
				<modifierfield>hp.surgemodifier</modifierfield>
				<source>
					<name>hp.total</name>
					<op>+</op>
				</source>
				<script>
					function onSourceValue(source, sourcename)
						if sourcename == "hp.total" then
							return math.floor(source.getValue() / 4);
						end

						return super.onSourceValue(source, sourcename);
					end
				</script>
			</sheetbonus>

			<buttoncontrol name="healsurge_button">
				<anchored>
					<to>healsurge</to>
					<position>above</position>
					<offset>-1</offset>
					<size>
						<height>23</height>
					</size>
				</anchored>
				<icon>
					<normal>button_surge</normal>
					<pressed>button_surge_down</pressed>
				</icon>
				<tooltip>
					<text>Apply healing surge</text>
				</tooltip>
				<script>
					function onButtonPress()
						CharSheetCommon.useHealingSurge(window.getDatabaseNode());
					end
				</script>
			</buttoncontrol>

			<savefield name="save" source="defenses.save.total">
				<anchored>
					<to>hpframe</to>
					<position>insidetopleft</position>
					<top>
						<offset>100</offset>
					</top>
					<left>
						<offset>120</offset>
					</left>
					<size>
						<height>20</height>
						<width>46</width>
					</size>
				</anchored>
				<tabtarget>
					<next>special</next>
					<prev>healsurgesused</prev>
				</tabtarget>
			</savefield>
			<stringcontrol name="savelabel">
				<anchored>
					<to>save</to>
					<position>lefthigh</position>
					<offset>0,3</offset>
					<size>
						<width>105</width>
						<height>20</height>
					</size>
				</anchored>
				<font>sheetlabel</font>
				<static>Saving Throw</static>
			</stringcontrol>

			<checkcounter name="faileddeathsaves">
				<anchored>
					<to>save</to>
					<position>righthigh</position>
					<offset>150,3</offset>
					<size>
						<height>20</height>
						<width>20</width>
					</size>
				</anchored>
				<sourcefields>
					<current>hp.faileddeathsaves</current>
					<maximum>hp.maxdeathsaves</maximum>
				</sourcefields>
				<script>
					function onInit()
						super.onInit();
						setMaxValue(3);
					end
				</script>
			</checkcounter>
			<stringcontrol name="faileddeathlabel">
				<anchored>
					<to>faileddeathsaves</to>
					<position>lefthigh</position>
					<offset>0,3</offset>
					<size>
						<width>120</width>
						<height>20</height>
					</size>
				</anchored>
				<font>sheetlabel</font>
				<static>Death Saves Failed</static>
			</stringcontrol>
			
			<labeledstring name="specialdefenses" source="defenses.special">
				<anchored>
					<to>hpframe</to>
					<position>insidetopleft</position>
					<offset>15,127</offset>
					<size>
						<height>20</height>
						<width>355</width>
					</size>
				</anchored>
				<label>Immune / Resist / Vulnerable</label>
				<tabtarget>
					<next>speedfinal</next>
					<prev>save</prev>
				</tabtarget>
			</labeledstring>

			<!-- SPEED -->
			<genericcontrol name="speedframe">
				<bounds>15,460,385,50</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<speedfield name="speedfinal" source="speed.final">
				<anchored>
					<to>speedframe</to>
					<position>insidetopleft</position>
					<offset>80,15</offset>
					<size>
						<width>45</width>
						<height>20</height>
					</size>
				</anchored>
			</speedfield>
			<stringcontrol>
				<anchored>
					<to>speedfinal</to>
					<position>lefthigh</position>
					<offset>0,3</offset>
					<size>
						<width>65</width>
					</size>
				</anchored>
				<font>sheetlabel</font>
				<static>Speed</static>
			</stringcontrol>
			<labeledstring name="speedspecial" source="speed.special">
				<anchored>
					<to>speedframe</to>
					<position>insidetopleft</position>
					<offset>135,17</offset>
					<size>
						<width>235</width>
						<height>20</height>
					</size>
				</anchored>
				<label>Special Movement</label>
			</labeledstring>

			<!-- SENSES -->
			<genericcontrol name="sensesframe">
				<bounds>15,510,385,80</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>
			
			<passiveskill name="passiveinsight">
				<anchored>
					<to>sensesframe</to>
					<position>insidetopleft</position>
					<offset>140,15</offset>
					<size>
						<width>45</width>
						<height>20</height>
					</size>
				</anchored>
				<sourcefields>
					<skillname>Insight</skillname>
					<statnodename>wisdom</statnodename>
				</sourcefields>
			</passiveskill>
			<stringcontrol>
				<anchored>
					<to>passiveinsight</to>
					<position>lefthigh</position>
					<offset>0,3</offset>
					<size>
						<width>125</width>
					</size>
				</anchored>
				<font>sheetlabel</font>
				<static>Passive Insight</static>
			</stringcontrol>
			
			<passiveskill name="passiveperception">
				<anchored>
					<to>sensesframe</to>
					<position>insidetopleft</position>
					<offset>325,15</offset>
					<size>
						<width>45</width>
						<height>20</height>
					</size>
				</anchored>
				<sourcefields>
					<skillname>Perception</skillname>
					<statnodename>wisdom</statnodename>
				</sourcefields>
			</passiveskill>
			<stringcontrol>
				<anchored>
					<to>passiveperception</to>
					<position>lefthigh</position>
					<offset>0,3</offset>
					<size>
						<width>120</width>
					</size>
				</anchored>
				<font>sheetlabel</font>
				<static>Passive Perception</static>
			</stringcontrol>
			
			<labeledstring name="senses">
				<anchored>
					<to>sensesframe</to>
					<position>insidetopleft</position>
					<offset>15,45</offset>
					<size>
						<width>355</width>
						<height>20</height>
					</size>
				</anchored>
				<label>Vision / Special Senses</label>
			</labeledstring>
			

			<!-- DEFENSES -->
			<genericcontrol name="defenseframe">
				<bounds>400,90,95,285</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>
			
			<defensemain name="ac" source="defenses.ac.total">
				<anchored>
					<to>defenseframe</to>
					<position>insidetopleft</position>
					<offset>25,34</offset>
					<size>
						<width>45</width>
						<height>40</height>
					</size>
				</anchored>
				<frame>
					<name>acicon</name>
					<offset>12,12,8,20</offset>
				</frame>
				<modifierfield>defenses.ac.temporary</modifierfield>
				<flag>encumbrance.heavyarmor</flag>
				<bonusfield1>abilities.dexterity.bonus</bonusfield1>
				<bonusfield2>abilities.intelligence.bonus</bonusfield2>
				<selectfield>defenses.ac.abilityname</selectfield>
				<showemptywidget />
				<source>
					<name>levelbonus</name>
					<op>+</op>
				</source>
				<source>
					<name>defenses.ac.armor</name>
					<op>+</op>
				</source>
				<source>
					<name>defenses.ac.misc</name>
					<op>+</op>
				</source>
			</defensemain>
			<stringcontrol>
				<anchored>
					<to>ac</to>
					<position>above</position>
					<offset>0,8</offset>
				</anchored>
				<font>sheetlabelmini</font>
				<static>AC</static>
				<center />
			</stringcontrol>

			<defensemain name="fortitude" source="defenses.fortitude.total">
				<anchored>
					<to>defenseframe</to>
					<position>insidetopleft</position>
					<offset>21,112</offset>
					<size>
						<width>54</width>
						<height>34</height>
					</size>
				</anchored>
				<modifierfield>defenses.fortitude.temporary</modifierfield>
				<bonusfield1>abilities.strength.bonus</bonusfield1>
				<bonusfield2>abilities.constitution.bonus</bonusfield2>
				<selectfield>defenses.fortitude.abilityname</selectfield>
				<source>
					<name>levelbonus</name>
					<op>+</op>
				</source>
				<source>
					<name>defenses.fortitude.misc</name>
					<op>+</op>
				</source>
			</defensemain>
			<stringcontrol>
				<anchored>
					<to>fortitude</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<font>sheetlabelmini</font>
				<static>Fortitude</static>
				<center />
			</stringcontrol>

			<defensemain name="reflex" source="defenses.reflex.total">
				<anchored>
					<to>fortitude</to>
					<position>below</position>
					<offset>0,25</offset>
					<size>
						<height>34</height>
					</size>
				</anchored>
				<modifierfield>defenses.reflex.temporary</modifierfield>
				<bonusfield1>abilities.dexterity.bonus</bonusfield1>
				<bonusfield2>abilities.intelligence.bonus</bonusfield2>
				<selectfield>defenses.reflex.abilityname</selectfield>
				<source>
					<name>levelbonus</name>
					<op>+</op>
				</source>
				<source>
					<name>defenses.reflex.armor</name>
					<op>+</op>
				</source>
				<source>
					<name>defenses.reflex.misc</name>
					<op>+</op>
				</source>
			</defensemain>
			<stringcontrol>
				<anchored>
					<to>reflex</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<font>sheetlabelmini</font>
				<static>Reflex</static>
				<center />
			</stringcontrol>

			<defensemain name="will" source="defenses.will.total">
				<anchored>
					<to>reflex</to>
					<position>below</position>
					<offset>0,25</offset>
					<size>
						<height>34</height>
					</size>
				</anchored>
				<modifierfield>defenses.will.temporary</modifierfield>
				<bonusfield1>abilities.wisdom.bonus</bonusfield1>
				<bonusfield2>abilities.charisma.bonus</bonusfield2>
				<selectfield>defenses.will.abilityname</selectfield>
				<source>
					<name>levelbonus</name>
					<op>+</op>
				</source>
				<source>
					<name>defenses.will.misc</name>
					<op>+</op>
				</source>
			</defensemain>
			<stringcontrol>
				<anchored>
					<to>will</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<font>sheetlabelmini</font>
				<static>Will</static>
				<center />
			</stringcontrol>

			<!-- COMBAT -->
			<genericcontrol name="combatframe">
				<bounds>400,375,95,215</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<init name="initiative" source="initiative.total">
				<anchored>
					<to>combatframe</to>
					<position>insidetopleft</position>
					<offset>21,32</offset>
					<size>
						<width>54</width>
						<height>34</height>
					</size>
				</anchored>
			</init>
			<stringcontrol>
				<anchored>
					<to>initiative</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<static>Initiative</static>
				<font>sheetlabelmini</font>
				<center />
			</stringcontrol>

			<melee_main name="meleeattackbonus" source="attacks.melee.total">
				<anchored>
					<to>initiative</to>
					<position>below</position>
					<offset>0,30</offset>
					<size>
						<height>34</height>
					</size>
				</anchored>
			</melee_main>
			<stringcontrol>
				<anchored>
					<to>meleeattackbonus</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<static>Melee</static>
				<font>sheetlabelmini</font>
				<center />
			</stringcontrol>

			<ranged_main name="rangedattackbonus" source="attacks.ranged.total">
				<anchored>
					<to>meleeattackbonus</to>
					<position>below</position>
					<offset>0,30</offset>
					<size>
						<height>34</height>
					</size>
				</anchored>
			</ranged_main>
			<stringcontrol>
				<anchored>
					<to>rangedattackbonus</to>
					<position>above</position>
					<offset>0,2</offset>
				</anchored>
				<static>Ranged</static>
				<font>sheetlabelmini</font>
				<center />
			</stringcontrol>

		</sheetdata>
	</windowclass>
</root>